<template>
  <a-tooltip title="点击切换企业/团队" placement="bottom">
    <router-link to="/enterprise" class="link">
      <a-button type="text" class="team-select btn-space-compact" v-if="store.enterprise.id">
        <a-avatar :src="store.enterprise.avatar" size="small"/>
        <span>{{ store.enterprise.name }}</span>
        <swap-outlined class="font-size-ssm team-swap"/>
      </a-button>
      <div class="team-select" v-else>
        <a-avatar size="small"><team-outlined/></a-avatar>
        请点击创建/加入企业</div>
    </router-link>
  </a-tooltip>
</template>
<script setup lang="ts">
import {useEnterpriseStore} from "@/store/enterprise";
import {SwapOutlined,TeamOutlined} from "@ant-design/icons-vue";
const store  = useEnterpriseStore()
</script>

<style scoped>
  .team-select {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color);
  }
  .team-swap {
    transform: rotate(90deg);
  }
</style>